﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="wfRegTrab.aspx.cs" Inherits="trabajo_wfRegTrab" ValidateRequest="false" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Registro de trabajos realizados</title>
    <link rel="stylesheet" href="../styles/a-main/a-main.css" type="text/css"/>    
    <script language="javascript" src="../include/toolkit.js"></script>
<script language="javascript" type="text/javascript">
// <!CDATA[

function ValidarMaximoValor(obj, valor) {
    var valor1 = obj.value;
    
    
    if(valor1 > valor) {
        alert("Debe ingresar un número menor que " + valor);
        obj.focus();
    }
    return false;
}


function btnLimpiarComp_onclick() {
document.getElementById('txtSATA').value="";
document.getElementById('txtAta').value = "";
document.getElementById('txtComp').value = "";
document.getElementById('lblDesComp').value = "";
document.getElementById('lblDesComp').style.visibility="hidden"
}

function popUpSelPerson(ctrl,ctrl2,PerCargo)
    {
    var url = "../persona/wfAddPerson.aspx?ctrl="+ctrl2+"&ccar="+PerCargo;
    window.open(url,"per","width=980,height=720,status=yes");
    }
    
    function OpenPreView(nomArch){
    window.open("../upload/" + nomArch, "_new","width:350, height:350;");
    }
    
    function ReCargarOpener() {
    window.opener.__doPostBack('cambiosRealizados','');
    window.close();
    }

// ]]>
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="content">
    <table width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td colspan="2" id="CptWFMain">
        Registro de trabajos</td>
    </tr>
    <tr>
    <td style="width: 1%"><img src="../styles/a-main/Bullet485.gif" border="0" /></td>
    <td><span class="sTit">Datos Generales</span></td>
    </tr>
        <tr>
            <td>
            </td>
            <td>
            <table width="780px" cellpadding="3" cellspacing="2">
                <tr>
                    <td colspan="7">
                    <table width="100%">
                    <tr>
                    <td style="width: 125px"><span class="lblCaption">Condición:</span></td>
                    <td style="width: 104px"><asp:DropDownList ID="ddl_Condicion" runat="server" CssClass="sel"></asp:DropDownList>
                        <asp:Label ID="lblCondicion" runat="server" CssClass="inTextData"></asp:Label></td>
                    <td style="width: 78px">
                        <span class="lblCaption">Origen:</span></td>
                    <td>
                        <asp:DropDownList ID="ddl_Origen" runat="server" CssClass="sel" AutoPostBack="True" OnSelectedIndexChanged="ddl_Origen_SelectedIndexChanged"></asp:DropDownList>
                        <asp:Label ID="lblOrigen" runat="server" CssClass="inTextData"></asp:Label></td>
                    <td></td>
                    <td align="right">
                        &nbsp;</td>
                    </tr>
                        <tr style="display:none" runat="server" id="displayNota">
                            <td style="width: 125px">
                                <span class="lblCaption">Nota:</span></td>
                            <td colspan="4">
                                <asp:TextBox ID="txtNotaPrg" runat="server" ReadOnly="True" Rows="4" TextMode="MultiLine"
                                    Width="550px" CssClass="inTextData"></asp:TextBox></td>
                            <td>
                            </td>
                        </tr>
                    </table>
                    <div id="divAtaSata" runat="server" style="display:none">
                    <table width="100%" cellpadding="3" cellspacing="2">
                        <tr>
                            <td style="width: 54px" class="lblCaption">
                                Ata</td>
                            <td style="width: 201px" class="lblCaption">
                                SubATA</td>
                            <td style="width: 45px" rowspan="2">
                                <asp:ImageButton ID="imgVerificarSubATA" runat="server" ImageUrl="../styles/a-main/BTVerificarSubATA.gif" OnClick="imgVerificarSubATA_Click" /></td>
                            <td rowspan="2">
                                &nbsp;<br />
        </td>
                            <td colspan="2" rowspan="2">
        <asp:Label ID="lblDesComp" runat="server" CssClass="lblCaption"></asp:Label>
        <asp:TextBox ID="txtComp" runat="server" CssClass="inTextData" Width="30px" MaxLength="2" Enabled="False" Visible="False">00</asp:TextBox></td>
                        </tr>
                    <tr>
                    <td style="width: 54px">
        <asp:TextBox ID="txtAta" runat="server" CssClass="inTextData" Width="30px" MaxLength="2"></asp:TextBox></td>
                    <td style="width: 201px"><asp:TextBox ID="txtSATA" runat="server"
                CssClass="inTextData" Width="30px" MaxLength="2"></asp:TextBox></td>
                    </tr>
                        <tr>
                            <td colspan="3">
                                <span class="lblCaption">Descripción del Trabajo:</span></td>
                            <td colspan="3" rowspan="1">
            <asp:TextBox ID="txtDesTrab" runat="server" CssClass="inTextData" Width="550px"></asp:TextBox></td>
                        </tr>
                    </table>
                    </div>
                    <div id="divTipoTrab" runat="server" style="display:none;">
                    <table width="100%">
                    <tr>
                    <td style="width: 228px">
              <span class="lblCaption">Tipo de Trabajo Realizado</span></td>
                    <td>
                                <asp:DropDownList ID="ddl_TipTrab" runat="server" CssClass="sel" Width="350px">
        </asp:DropDownList>
                        <asp:Label ID="lblTipTrab" runat="server" CssClass="inTextData"></asp:Label></td>
                    <td></td>
                    <td></td>
                    </tr>
                    </table>
                    </div>
                    </td>
                </tr>
            </table>
            </td>
        </tr>
        <tr>
            <td style="width: 1%">
                <img src="../styles/a-main/Bullet485.gif" border="0" /></td>
            <td>
                <span class="sTit">Detalle del Informe&nbsp;</span></td>
        </tr>
        <tr>
            <td style="width: 1%">
            </td>
            <td>
                    <table width="780">
                        <tr>
                            <td>
                                <span class="lblCaption">Tiempo Real Utilizado:</span></td>
                            <td style="font-size: 12pt; font-family: Times New Roman">
              <asp:TextBox ID="txtTiempoRealUtil" onBlur="return ValidarMaximoValor(this,999)" onKeyPress="return ValidaFormatDecimal(event);" runat="server" CssClass="inTextData" Width="50px" MaxLength="5"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTiempoRealUtil"
                                    ErrorMessage="El tiempo real utilizado debe ser ingresado" ValidationGroup="1">*</asp:RequiredFieldValidator></td>
                            <td colspan="2" style="font-weight: bold; font-size: 9pt; color: #10459c; font-family: Arial">
                            </td>
                            <td style="font-weight: bold; font-size: 9pt; color: #10459c; font-family: Arial">
                            </td>
                            <td style="font-weight: bold; font-size: 9pt; color: #10459c; font-family: Arial">
                            </td>
                        </tr>
                        <tr style="font-weight: bold; font-size: 9pt; color: #10459c; font-family: Arial">
                            <td>
            <span class="lblCaption">Estado del Trabajo:</span></td>
                            <td style="font-size: 12pt; font-family: Times New Roman">
            <asp:DropDownList ID="ddl_EstTrab" runat="server" CssClass="sel" Width="250px" AutoPostBack="True" OnSelectedIndexChanged="ddl_EstTrab_SelectedIndexChanged">
        </asp:DropDownList></td>
                            <td colspan="2" style="font-size: 12pt; font-family: Times New Roman">
                            <div id="DivDiferido" style="display:none;" runat="server">
              <span class="lblCaption">Número Diferido:</span>
              <asp:TextBox ID="txtNumDiferido" runat="server" CssClass="inTextData"></asp:TextBox>
              </div></td>
                            <td>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="6">
                            <div id="DivTrabRel" style="display:none" runat="server">
                            <span class="lblCaption">Trabajo Relacionado:</span>
                                <asp:GridView ID="gvTrab" runat="server" AutoGenerateColumns="False" DataKeyNames="Id,SecuenciaTrabajo" OnRowCreated="gvTrab_RowCreated" EnableViewState="False" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical">
                                    <Columns>
                                        <asp:BoundField HeaderText="Tipo Trabajo" />
                                        <asp:BoundField HeaderText="Componente" />
                                        <asp:BoundField HeaderText="Horas Hombre" />
                                        <asp:TemplateField HeaderText="Seleccionar">
                                            <ItemTemplate>
                                                <input name="radMyRadio" type="radio" value='<%# Eval("SecuenciaTrabajo") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                                    <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                                    <RowStyle BackColor="#EEEEEE" ForeColor="Black" CssClass="RowGrid" />
                                    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                                    <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                                    <AlternatingRowStyle BackColor="Gainsboro" />
                                </asp:GridView>
                                &nbsp;&nbsp;
                                </div>
                            </td>
                        </tr>
                    </table>
            </td>
        </tr>
        <tr>
            <td style="width: 1%;">
            <img src="../styles/a-main/Bullet485.gif" border="0" /></td>
            <td><span class="sTit">Acciones y Observaciones </span></td>
        </tr>
        <tr>
            <td style="width: 1%">
            </td>
            <td>
            <table width="780px">            
                <tr>
                    <td>
                    <span class="lblCaption">Acción Tomada:</span></td>
                    <td>
                    </td>
                    <td>
            <span class="lblCaption">Problemas encontrados:</span></td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td>
        <asp:TextBox ID="txtAccion" runat="server" CssClass="inTextData" Height="100px" TextMode="MultiLine" Width="350px"></asp:TextBox></td>
                    <td>
                    </td>
                    <td>
            <asp:TextBox ID="txtObs" runat="server" CssClass="inTextData" Height="100px" TextMode="MultiLine" Width="350px"></asp:TextBox></td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td colspan="7" align="center">
            <asp:ImageButton ID="imgGrabar" runat="server" ImageUrl="../styles/a-main/BTgrabar.gif"
                            OnClick="imgGrabar_Click" ValidationGroup="1" /></td>
                </tr>
            </table>
            </td>
        </tr>
        <tr>
            <td style="width: 1%; height: 19px">
                <img src="../styles/a-main/Bullet485.gif" border="0" /></td>
            <td style="height: 19px">
                <strong><span style="font-size: 10pt; color: #a60f38; font-family: Arial">Archivos adjuntos.</span></strong></td>
        </tr>
        <tr>
            <td style="width: 1%; height: 19px">
            </td>
            <td>
                        <table width="780" cellpadding="3" cellspacing="2" style="display:none" runat="server" id="tblDisplayAdjuntos">
                            <tr>
                                <td><span class="lblCaption">Archivo o Foto:</span></td>
                                <td colspan="5" style="font-size: 12pt; font-family: Times New Roman">
            <asp:FileUpload ID="fileUpLoad" runat="server" Width="500px" />&nbsp;
                                    <asp:ImageButton ID="imgSubir" runat="server" ImageUrl="../styles/a-main/BTcargar.gif" OnClick="imgSubir_Click" /></td>
                            </tr>
                            <tr style="font-size: 12pt; font-family: Times New Roman">
                                <td colspan="6" valign="top">
                                    <table width="100%">
                                        <tr>
                                            <td rowspan="1">
                                    <span class="lblCaption">Archivos Cargados:</span></td>
                                            <td>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td rowspan="2">
                                    <asp:GridView ID="gvFileUpload" runat="server" AutoGenerateColumns="False" BackColor="White"
                                        BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="IdTrab,SeqInfTrab,SeqFileUp"
                                        GridLines="Vertical" OnRowCommand="gvFileUpload_RowCommand" Width="100%">
                                        <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                                        <Columns>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <a href="javascript:OpenPreView('<%# Eval("NombFileUp") %>');"><img src="../styles/a-main/Gafas.png" border="0" /></a>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="NombFileUp" HeaderText="Archivo" />
                                            <asp:BoundField DataField="SizeFileUp" HeaderText="Tama&#241;o" />
                                            <asp:ButtonField Text="Eliminar" />
                                        </Columns>
                                        <RowStyle BackColor="#EEEEEE" ForeColor="Black" CssClass="RowGrid" />
                                        <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                                        <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                                        <AlternatingRowStyle BackColor="Gainsboro" />
                                    </asp:GridView>
                                            </td>
                                            <td>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
            </td>
        </tr>
        <tr>
            <td style="height: 19px; width: 1%;"><img src="../styles/a-main/Bullet485.gif" border="0" /></td>
            <td style="height: 19px"><span class="sTit">Paticipantes</span></td>
        </tr>
        <tr>
            <td style="width: 1%; height: 19px">
            </td>
            <td>
                <table width="780px" cellpadding="3" cellspacing="2" id="tblDisplayMecanico" style="display:none" runat="server">
                    <tr>
                        <td>
                        <span class="lblCaption">Mecánico:</span></td>
                        <td>
    <asp:TextBox ID="txtParticipante" ContentEditable="false" runat="server" CssClass="inTextData" Width="350px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvMecanico" runat="server" ErrorMessage="El Mecanico es requerido"
                                ValidationGroup="m" ControlToValidate="txtParticipante">*</asp:RequiredFieldValidator>
    <img id="imgParticipante" border="0" onclick="popUpSelPerson(this, 'txtParticipante', '40')" src="../styles/cssmain/Personas.gif" /></td>
                        <td rowspan="2">
                        &nbsp;
                            <asp:ImageButton ID="imgAgregarPers" runat="server" ImageUrl="../styles/a-main/BTagregar.gif" OnClick="imgAgregarPers_Click" ValidationGroup="m" /></td>
                        <td>
                        </td>
                        <td>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
            <span class="lblCaption">Participación:</span></td>
                        <td>
            <asp:DropDownList ID="ddlParticipacion" runat="server" CssClass="sel" Width="350px">
            </asp:DropDownList></td>
                        <td>
                        </td>
                        <td>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6">
<asp:GridView ID="gvParticipantes" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical" Width="100%" OnRowDataBound="gvParticipantes_RowDataBound" OnRowCommand="gvParticipantes_RowCommand" DataKeyNames="IdTrabajo,SecuenciaTrabajo,IdTrabajador">
    <Columns>
        <asp:BoundField DataField="NombreTrabajador" HeaderText="Personal Participante" />
        <asp:BoundField HeaderText="Tipo Participacion" />
        <asp:ButtonField CommandName="Eliminar" Text="Eliminar" />
    </Columns>
    <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
    <RowStyle BackColor="#EEEEEE" ForeColor="Black" CssClass="RowGrid" />
    <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
    <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
    <AlternatingRowStyle BackColor="Gainsboro" />
</asp:GridView> 
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="width: 1%; height: 62px">
            </td>
            <td align="center" style="height: 62px">
                <img id="imgCloseWindow" src="../styles/a-main/BTCerrar.gif" onclick="javascript:ReCargarOpener();" /></td>
        </tr>
    </table>
    </div>
            <asp:HiddenField ID="hid_Idtrab" runat="server" />
        <asp:HiddenField ID="hid_CodComponente" runat="server" />
        <asp:HiddenField ID="hid_InfTraSeq" runat="server" />
        <asp:HiddenField ID="hid_PermitirEdicion" runat="server" />
    </form>
</body>
</html>